/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.hazardsource.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.koron.ebs.mybatis.EnvSource;

import com.koron.hazardsource.domain.HiddenDanger;


public interface HiddenDangerMapper {
	HiddenDanger queryById(@Param("tableName") String tableName,@Param("id") String id);
	List<HiddenDanger> queryListById(@Param("tableName") String tableName,@Param("idList") List<String> idList);
	HiddenDanger queryOneByCode(@Param("code") String code);
	List<HiddenDanger> queryListByCode(@Param("code") String code);
	Integer count(@Param("name")String name,@Param("dangerTypeId")String dangerTypeId,
			@Param("dangerLevelId")String dangerLevelId,@Param("firstElementId")String firstElementId,
			@Param("secondElementId")String secondElementId,@Param("description")String description,@Param("state")Integer state);
	List<HiddenDanger> list(@Param("name")String name,@Param("dangerTypeId")String dangerTypeId,
			@Param("dangerLevelId")String dangerLevelId,@Param("firstElementId")String firstElementId,
			@Param("secondElementId")String secondElementId,@Param("description")String description,
			@Param("state")Integer state,@Param("start") Integer start, @Param("rows") Integer rows);
	Integer insert(@Param("tableName")String tableName,@Param("bean") HiddenDanger bean);
	Integer batchInsert(@Param("tableName")String tableName,@Param("beanList") List<HiddenDanger> beanList);
	Integer batchDelete(@Param("tableName")String tableName,@Param("idList") List<String> idList);
	Integer update(@Param("tableName")String tableName,@Param("bean") HiddenDanger bean);
	Integer updateState(@Param("codeList") List<String> codeList,@Param("state")int state);
	Integer updateFstatusflag(@Param("idList") List<String> idList,@Param("fstatusflag") int fstatusflag);
	List<HiddenDanger> getDraftList(@Param("userCode") String userCode);
	Integer updateDisposalState(@Param("idList")List<String> idList,@Param("disposalState")Integer disposalState);
	
	@Delete("delete from hidden_danger_history where id=#{id}")
	Integer deleteDraft(@Param("id") String id);
	
	@Update("update hidden_danger_history set code=#{code} where id=#{id}")
	Integer updateCode(@Param("id") String id,@Param("code") String code);

	/**
	 * 根据描述模糊匹配标准隐患
	 * @param description
	 * @return
	 */
	List<HiddenDanger> queryByDescription(@Param("description") String description);
}
